Add fork-safe PR workflow and permissions#73
Merged
bschwedler merged 12 commits intomainfrom Apr 28, 2026
Merged
Conversation
ianpittwood
approved these changes
Apr 23, 2026
6de949e to
3d087c8
Compare
|
You are seeing this message because GitHub Code Scanning has recently been set up for this repository, or this pull request contains the workflow file for the Code Scanning tool. What Enabling Code Scanning Means:
For more information about GitHub Code Scanning, check out the documentation. |
f99cab6 to
8486930
Compare
Dedicated PR workflow that calls bakery-build-pr.yml, which is safe for fork PRs (no secrets required). Consolidates all three build types (production, development, session) into a single workflow with a unified CI gate.
PR builds are now handled by the dedicated pr.yml workflow which uses bakery-build-pr.yml (fork-safe, no secrets).
The if condition referenced cron '15 3 * * 0' but the actual schedule is '15 4 * * 0'. With pull_request removed, simplify to check event_name directly instead of matching cron strings.
Set top-level permissions: {} on all workflows and per-job
permissions: {} on CI meta-jobs and the issues job. This
follows the principle of least privilege by requiring each
job to explicitly declare the permissions it needs.
Top-level permissions on workflows that call reusable workflows acts as a ceiling, blocking job-level grants from reaching the callee. Remove it from all workflows except issues.yml (which doesn't call reusable workflows). Per-job permissions remain.
Mutable tags can be overwritten, allowing supply chain attacks. Pin to immutable commit SHAs with specific version comments so Dependabot can track updates.
Add zizmor job to PR workflows and a .github/zizmor.yml policy that allows ref-pinned images-shared refs while requiring hash-pinning for all third-party actions.
The release workflow was the only workflow without explicit permissions, inheriting the repo default. Add least-privilege permissions (contents:write, pull-requests:write) to match what product-release.yml needs, plus a 10-minute timeout.
- Downgrade packages:write to packages:read on PR build jobs — PR builds never push, cache is read-only - Add security-events:write to zizmor job for SARIF upload to the Security tab
Add workflow_dispatch to the session build job's if condition — it was excluded, making manual dispatch a no-op despite the push input already handling it. Grant packages: write on PR caller jobs so bakery-build-pr.yml can write to GHCR caches on internal PRs. Fork PRs are unaffected by GitHub's platform-enforced read-only token.
Remove stale concurrency comments referencing pull_request trigger which no longer exists on these workflows. Replace archived actions-ecosystem/action-add-labels with gh issue edit.
GitHub creates a check run for modified workflow files on push even when the file only triggers on workflow_dispatch. The run fails because inputs.version is undefined in a push context.
8486930 to
a51825b
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pr.ymlcallingbakery-build-pr.yml@mainfor fork-safe PR builds (production, development, session)pull_requesttrigger from existing build workflows (handled bypr.yml)session.ymlcron mismatch ('15 3 * * 0'condition vs'15 4 * * 0'cron)permissions: {}at workflow level + per-job declarationsPart of rstudio/platform-team#435.
Test plan
pr.ymlruns on this PR